package com.hyk.service.impl;

import com.hyk.entity.Role;
import com.hyk.entity.request.UserRoleRequest;
import com.hyk.mapper.RoleMapper;
import com.hyk.service.IRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hyk
 * @since 2021-03-16
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements IRoleService {

    @Resource
    private RoleMapper roleMapper;

    @Override
    public void distribution(UserRoleRequest userRoleRequest) {
        userRoleRequest.setCreateTime(new Date());
        userRoleRequest.setUpdateTime(new Date());
        roleMapper.distribution(userRoleRequest);
    }
}
